home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK2.toast / Development Kits / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Timer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  3.6 KB  |  137 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Timer.h
  3.  
  4.      Contains:    Time Manager interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1985-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __TIMER__
  19. #define __TIMER__
  20.  
  21. #ifndef __CONDITIONALMACROS__
  22. #include <ConditionalMacros.h>
  23. #endif
  24. #ifndef __MACTYPES__
  25. #include <MacTypes.h>
  26. #endif
  27. #ifndef __OSUTILS__
  28. #include <OSUtils.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53.  
  54. enum {
  55.                                                                 /* high bit of qType is set if task is active */
  56.     kTMTaskActive                = (1L << 15)
  57. };
  58.  
  59. typedef struct TMTask                     TMTask;
  60. typedef TMTask *                        TMTaskPtr;
  61. typedef CALLBACK_API( void , TimerProcPtr )(TMTaskPtr tmTaskPtr);
  62. /*
  63.     WARNING: TimerProcPtr uses register based parameters under classic 68k
  64.              and cannot be written in a high-level language without 
  65.              the help of mixed mode or assembly glue.
  66. */
  67. typedef REGISTER_UPP_TYPE(TimerProcPtr)                         TimerUPP;
  68.  
  69. struct TMTask {
  70.     QElemPtr                         qLink;
  71.     short                             qType;
  72.     TimerUPP                         tmAddr;
  73.     long                             tmCount;
  74.     long                             tmWakeUp;
  75.     long                             tmReserved;
  76. };
  77.  
  78.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  79.                                                                                             #pragma parameter InsTime(__A0)
  80.                                                                                             #endif
  81. EXTERN_API( void )
  82. InsTime                            (QElemPtr                 tmTaskPtr)                            ONEWORDINLINE(0xA058);
  83.  
  84.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  85.                                                                                             #pragma parameter InsXTime(__A0)
  86.                                                                                             #endif
  87. EXTERN_API( void )
  88. InsXTime                        (QElemPtr                 tmTaskPtr)                            ONEWORDINLINE(0xA458);
  89.  
  90.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  91.                                                                                             #pragma parameter PrimeTime(__A0, __D0)
  92.                                                                                             #endif
  93. EXTERN_API( void )
  94. PrimeTime                        (QElemPtr                 tmTaskPtr,
  95.                                  long                     count)                                ONEWORDINLINE(0xA05A);
  96.  
  97.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  98.                                                                                             #pragma parameter RmvTime(__A0)
  99.                                                                                             #endif
  100. EXTERN_API( void )
  101. RmvTime                            (QElemPtr                 tmTaskPtr)                            ONEWORDINLINE(0xA059);
  102.  
  103. EXTERN_API( void )
  104. Microseconds                    (UnsignedWide *            microTickCount)                        FOURWORDINLINE(0xA193, 0x225F, 0x22C8, 0x2280);
  105.  
  106. enum { uppTimerProcInfo = 0x0000B802 };                         /* register no_return_value Func(4_bytes:A1) */
  107. #define NewTimerProc(userRoutine)                                 (TimerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTimerProcInfo, GetCurrentArchitecture())
  108. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  109.     #pragma parameter CallTimerProc(__A0, __A1)
  110.     void CallTimerProc(TimerUPP routine, TMTaskPtr tmTaskPtr) = 0x4E90;
  111. #else
  112.     #define CallTimerProc(userRoutine, tmTaskPtr)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppTimerProcInfo, (tmTaskPtr))
  113. #endif
  114.  
  115.  
  116.  
  117. #if PRAGMA_STRUCT_ALIGN
  118.     #pragma options align=reset
  119. #elif PRAGMA_STRUCT_PACKPUSH
  120.     #pragma pack(pop)
  121. #elif PRAGMA_STRUCT_PACK
  122.     #pragma pack()
  123. #endif
  124.  
  125. #ifdef PRAGMA_IMPORT_OFF
  126. #pragma import off
  127. #elif PRAGMA_IMPORT
  128. #pragma import reset
  129. #endif
  130.  
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134.  
  135. #endif /* __TIMER__ */
  136.  
  137.